<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <title>机构管理</title>
    <link href="${ctxPath}/css/bootstrap.min.css?v=3.3.6" rel="stylesheet"/>
    <link href="${ctxPath}/css/font-awesome.css?v=4.4.0" rel="stylesheet"/>
    <link href="${ctxPath}/css/animate.css" rel="stylesheet"/>
    <link href="${ctxPath}/css/style.css?v=4.1.0" rel="stylesheet"/>
    <link href="${ctxPath}/css/plugins/treeview/bootstrap-treeview.css" rel="stylesheet"/>
</head>

<body class="gray-bg">
<div class="wrapper wrapper-content  animated fadeInRight">
    <div class="row">
        <div class="col-sm-4">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>机构</h5>
                </div>
                <div class="ibox-content">
                    <div class="btn-group hidden-xs" id="exampleToolbar" role="group">
                        @if(shiro.hasPermission("deptmgr_add")){
                        <button class="btn btn-outline btn-success  dim" type="button" onclick="addDept();">
                            <i class="fa fa-plus">&nbsp;新增</i>
                        </button>
                        @}
                        @if(shiro.hasPermission("deptmgr_edit")){
                        <button id="editButton" class="btn btn-outline btn-warning  dim" type="button" onclick="editDept();">
                            <i class="fa fa-edit">&nbsp;编辑</i>
                        </button>
                        @}
                        @if(shiro.hasPermission("deptmgr_del")){
                        <button id="delButton" class="btn btn-outline btn-danger  dim " type="button" onclick="delDept();">
                            <i class="fa fa-trash">&nbsp;删除</i>
                        </button>
                        @}
                    </div>
                    <div id="deptTree"></div>
                </div>
            </div>
        </div>
        <div class="col-sm-8">
            <div class="ibox ">
                <div class="ibox-title">
                    <h5>详细信息</h5>
                </div>
                <div class="ibox-content">
                    <div class="row">
                        <form class="form-horizontal" id="deptForm">
                            <div class="form-group">
                                <label class="col-sm-3 control-label">ID：</label>
                                <div class="col-sm-8">
                                    <input type="text" id="id" name="id" disabled="" placeholder="id" class="form-control"/>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">简称：</label>
                                <div class="col-sm-8">
                                    <input type="text" id="name" name="name" disabled="" placeholder="简称" class="form-control"/>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">全称：</label>
                                <div class="col-sm-8">
                                    <input type="text" id="fullName" name="fullName" disabled="" placeholder="全称" class="form-control"/>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">排序：</label>
                                <div class="col-sm-8">
                                    <input type="text" id="sort" name="sort" disabled="" placeholder="输入数字" class="form-control"/>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">父机构：</label>
                                <div class="col-sm-8">
                                    <input type="hidden" id="pId" name="pId" value=""/>
                                    <input type="text" id="pName" name="pName" disabled="" readonly="readonly" onclick="hideParentDeptTree()" placeholder="选择父机构" class="form-control"/>
                                    <div id="parentDeptTree" style="display: none;"></div>
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">备注：</label>
                                <div class="col-sm-8">
                                    <input type="text" id="tips" name="tips" disabled="" placeholder="请输入备注" class="form-control"/>
                                </div>
                            </div>
                        </form>
                    </div>
                    <div id="deptSubmit" class="row" style="display: none;">
                        <div class="col-sm-12">
                            <div class="col-sm-4"></div>
                            <div class="col-sm-4">
                                <a id="saveButton" class="btn btn-primary btn-rounded btn-block" onclick="saveUser()"><i class="fa fa-check-circle"></i> 保存</a>
                            </div>
                            <div class="col-sm-4"></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- 全局js -->
<script src="${ctxPath}/js/jquery.min.js?v=2.1.4"></script>
<script src="${ctxPath}/js/bootstrap.min.js?v=3.3.6"></script>

<!-- Bootstrap table -->
<script src="${ctxPath}/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
<script src="${ctxPath}/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
<script src="${ctxPath}/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>

<!-- Peity -->
<script src="${ctxPath}/js/plugins/peity/jquery.peity.min.js"></script>
<script src="${ctxPath}/js/plugins/layer/layer.min.js"></script>

<!-- 自定义js -->
<script src="${ctxPath}/js/admin/dept/list.js"></script>

<!-- Bootstrap-Treeview plugin javascript-->
<script src="${ctxPath}/js/plugins/treeview/bootstrap-treeview.js"></script>

</body>

</html>
